<template>
  <div class="zw-person">
    <div class="zw-header">
      <div class="zw-header__col">
        <img src="http://cdn.gee4.cn/zw-wx/wx-vue-img-v2/img/v2/avatar_0228.png" alt="" class="avatar">
      </div>
      <div class="zw-header__col">
        <p>{{info.name}}</p>
        <p>{{info.phone}}</p>
      </div>
      <div class="zw-header__col" @click="goToQr">
        <img src="http://cdn.gee4.cn/zw-wx/wx-vue-img-v2/img/v2/QRcode.png" alt="" class="avatar">
      </div>
    </div>
    <div class="zw-card">
      <div class="zw-card--head" @click="goToEditBank"><i class="icon icon1"></i> <span class="bank-name">银行账户信息</span> <span class="edit">编辑</span></div>
      <ul class="zw-card--des">
        <li>
          <span class="title">账户名：&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="value">{{info.bankAccountName || '暂无'}}</span>
        </li>
        <li>
          <span class="title">开户行：&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="value">{{info.bankName || '暂无'}}</span>
        </li>
        <li>
          <span class="title">银行卡号：</span><span class="value">{{info.bankCardNumber || '暂无'}}</span>
        </li>
      </ul>
    </div>
    <div class="zw-card" @click="goToExchange">
      <div class="zw-card--head"><i class="icon icon2 mr"></i>积分结算</div>
    </div>
    <div class="zw-card" @click="goToEditPw">
      <div class="zw-card--head"><i class="icon icon3 mr"></i>修改密码</div>
    </div>
  </div>
</template>
<script>
import { Toast, Indicator } from 'mint-ui';
import { mapActions, mapGetters } from 'vuex';
import { wxshare } from 'common/mixin'

export default {
  mixins: [wxshare],
  data() {
    return {
      info: {}
    }
  },
  watch: {
    '$route' (to, from) {
      this.getList();
    }
  },
  methods: {
    ...mapActions({
      getChannelDetail: 'GetChannelDetail',
    }),
    goToQr() {
      this.$router.push({ path: '/channel/portalQr' });
    },
    goToEditPw() {
      this.$router.push({ path: '/doctor/resetPassword' });
    },
    goToExchange(){
      this.$router.push({ path: '/exchange' });
    },
    goToEditBank(){
      this.$router.push({ path: '/doctor/editBank' });
    }

  },
  created() {
    this.getChannelDetail().then(data => {
      console.log(data)
      this.info = data;
    }).catch(msg => {

    })
  },
}

</script>
<style scoped lang="less">
@import './me.css';

.bank-name {
  display: inline-block;
  width: 70%;
}

.edit {
  font-size: 0.9rem;
  color: #FD7D6A;
}

.mr {
  margin-right: 0.3rem;
}






/*@import './channelList.less';*/

</style>
